/*************************************************************************
    > File Name: book.cpp
    > Author: skylon
    > Site: blog.csdn.net/tcm_zhangpeng  
    > Created Time: 2016年05月14日 星期六 20时48分10秒
 ************************************************************************/

#include<iostream>
#include<string>
using namespace std;
class buyer	//	base_class
{
protected:
	string name;	//	name
	int buyerID;	//	ID of buyer
	string address;	//	address of buyer
	double pay;	// money of books
public:
	buyer();
	buyer(string n, int b, string a, double p);
	string getbuyname();
	string getaddress();
	double getpay();
	int getid();
	virtual void display() = 0;	//	display object
	virtual void setpay(double = 0) = 0;	//	calc money of books
};

class member:public buyer	//	VIP
{
private:
	int leaguer_grade;	//	Lv of VIP
public:
	member(string n, int b, int l, string a, double p):buyer(n, b, a, p)
	{
		leaguer_grade = l;
	}
	void display();	//	display information of VIP
	void setpay(double p);	//	discount_rate
};

class honoured_guest:public buyer	//	honoured_guest
{
private:
	double discount_rate;	//	discount_rate
public:
	honoured_guest(string n, int b, double r, string a, double p):buyer(n, b, a, p)
	{
		discount_rate = r;
	}
	void display();	//	display information of honoured_guest
	void setpay(double p);	//	discount_rate
};

class layfolk:public buyer	//	ordinary_guest
{
public:
	layfolk(string n, int b, string a, double p):buyer(n, b, a, p)
	{

	}
	void display();
	void setpay(double p);
};

